package com.spyx.sys.controller;


import com.atyx.spyx.model.sys.Region;
import com.spyx.result.Result;
import com.spyx.sys.service.RegionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 地区表 前端控制器
 * </p>
 *
 * @author yhp
 * @since 2024-05-14
 */
@RestController
@RequestMapping("/admin/sys/region")
@Api(tags="区域管理")
//@CrossOrigin
public class RegionController {
    @Autowired
    private RegionService regionService;

    //根据区域关键字查询区域对象
    @GetMapping("/findRegionByKeyword/{keyword}")
    @ApiOperation("根据区域关键字查询区域对象")
    public Result find(@PathVariable("keyword")String keyword){
       List<Region> regionList=regionService.findByKeyword(keyword);
        return Result.ok(regionList);
    }

}

